import type {ApiResult, PageParam, PageResult} from '~/types/global'
import type {OptLog} from '~/types/log/optLog'
import {request} from '~/utils/request'

enum Api {
  Page = '/logs/optLog/page',
  Common = '/logs/optLog',
}

/**
 * 分页查询
 * @return
 */
export function pageOptLogApi(param: PageParam<OptLog>) {
  return request.post<ApiResult<PageResult<OptLog>>>(Api.Page, { data: param })
}

/**
 * 单体查询
 * @param id
 * @return
 */
export function getOptLogApi(id: string) {
  return request.get<ApiResult<OptLog>>(`${Api.Common}/${id}`)
}
